// ******************************************************************
// Table 4: Robustness checks using assessment roll data for Montréal
// ******************************************************************

// Writes the results as reg_montreal to $resultpath/tables/

use "$outpath/database_for_reg.dta", clear

eststo clear

global instruct "tdec(3) rdec(3) auto(3) bdec (3) symbol($^a$,$^b$,$^c$) se e(r2_p) tex label nocons"

//Benchmark parcel on Montreal sample
xi: reghdfe Lnland_pwc dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid)  vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", replace $instruct keep(dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)

//Parcel on Montreal sample with roll data
xi: reghdfe Lnland_pwc_role dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct  Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid)  vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", append $instruct keep(dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)

//Parcel on Montreal sample with roll data and local density
xi: reghdfe Lnland_pwc_role Lnda_density05 dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct  Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid)  vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", append $instruct keep(Lnda_density05 dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)

//Benchmark ratio on Montreal sample
xi: reghdfe ratio dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid) vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", append $instruct keep(dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)

//Ratio on Montreal sample with roll data
xi: reghdfe ratio_bis dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid) vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", append $instruct keep(dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)

//Ratio on Montreal sample with roll data and local density
xi: reghdfe ratio_bis Lnda_density05 dist_min_NEW i.cat0 number_NEQ number_NEQ2 number_NEQ3 number_NEQ4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction if samplep==1&mtl_in==1, absorb(naics4d eruid) vce(robust)
outreg2 using "$resultpath/tables/reg_montreal.xls", append $instruct keep(Lnda_density05 dist_min_NEW _Icat0_2  _Icat0_3 _Ihoffice_2  _Iexports_2 spacematep spacematep2 spacematep3 spacematep4 Lnemp  NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_stat_freight Lndist_junction)
